﻿using System;
using System.Reflection;

namespace CodeContrib.Hydrator
{
	public class EnumMap : IMap
	{
		Type IMap.Type
		{
			get { return typeof (object); }
		}

		bool IMap.IsMatch(PropertyInfo propertyInfo)
		{
			return propertyInfo.PropertyType.IsEnum;
		}

		IMapping IMap.Mapping(PropertyInfo propertyInfo)
		{
			return new Mapping<object>(propertyInfo, new RandomEnum(propertyInfo.PropertyType));
		}
	}
}